#pragma once
#include "velement.h"

class VTTFFont :
    public VElement
{
public:
    VTTFFont(void);
    ~VTTFFont(void);

    bool load(const std::string& ttf_file_path, int ptsize);

public: // properties
    bool bold();
    void setBold(bool bold);
    bool italic();
    void setItalic(bool italic);
    bool underline();
    void setUnderline(bool underline);
    /* // invalid in wince
    bool strikeline();
    void setStrikeline(bool strikeline);
    */
    int size();
    void setSize(int size);

public: // interfaces
    int fontHeight() const;
    char* fontFamilyName() const;
    void sizeText(const std::string& text, int* w, int* h) const;

public: // render
    GLuint renderText(const std::string& text,
                      unsigned char r,
                      unsigned char g,
                      unsigned char b);

public: // static member
    static bool init();

protected:
    TTF_Font* _font;
    bool _loaded;
};
